﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Exdot
{
    public class IOMoney
    {
        public void WriteFile(String money)
        {
            StreamWriter sw;
            try
            {
                 sw = new StreamWriter(new FileStream("Money.txt", FileMode.Open));
            }
            catch
            {
                sw = new StreamWriter(new FileStream("Money.txt", FileMode.CreateNew));
            }
            sw.WriteLine(money);
            sw.Close();
        }
        public String ReadFile()
        {
            String s = "";
            String line;
            StreamReader sr = new StreamReader(new FileStream("Money.txt", FileMode.Open));
            while ((line = sr.ReadLine()) != null)
            {
                s += line + "\n";
            }
            sr.Close();
            return s;
        }
    }
}
